package com.googlecode.mvchat.interfaces;

import com.googlecode.mvchat.interfaces.impl.ClientImpl;
import com.googlecode.mvchat.protocol.Message;

public abstract class Client {

	protected static long id;
	
	public static Client getTestClient(){
		
		
		Client test = new ClientImpl();
		test.id = 123L;
		return test;
	}
	
	
	public long id(){
		return id;
	}
	public void setId(long newId){
		id = newId;
	}
	
	public static void onRecieve(byte[] arr){
		Message m = new Message();
		m.populateFromByteArray(arr);
		if(m.getReciever() == id){
			System.out.println("Recieved message from: "+m.getSender()+", containing: ");
			System.out.println("\""+m.getMessage()+"\"");
		}
	}
	
}
